package com.sunwayhorizo.health.hl7.persistent;

import com.sunwayhorizo.health.hl7.persistent.pk.RimCoreEntyAddrPartsPK;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.TableGenerator;


@Entity
@TableGenerator(name="EntityAddrParts_IdGenerator", table="RIM_Id_Generator", pkColumnName = "pkColumn", valueColumnName = "valueColumn",pkColumnValue="Enty_AddrParts")
//@NamedQuery(name = "EntyAddrParts.findAll", query = "select o from EntyAddrParts o")
@Table(name = "RIM_CORE_ENTY_ADDR_PARTS")
@IdClass(RimCoreEntyAddrPartsPK.class)
public class RimCoreEntyAddrParts implements Serializable {
    @Id
    @Column(name="ENTITY_ID", nullable = false, insertable = false, updatable = false)    private Long entityId;
    @Id
    @Column(name="ENTITY_VERSION_NUM", nullable = false, insertable = false, updatable = false)    private Long entityVersionNum;
    @Id
    @Column(name="ADDRESS_ID", nullable = false, insertable = false, updatable = false)    private Long addressId;
    @Id
    @GeneratedValue (strategy = GenerationType.TABLE,generator = "EntityAddrParts_IdGenerator" )
    @Column(name="ADDRESS_PART_ID", nullable = false)    private Long addressPartId;   
    
    @Column(name="PART_ORDER_NUM")    private Long partOrderNum;
    @Column(name="ADDRESS_PART_TYPE_CODE")    private String PartType;    
    @Column(name="ADDRESS_PART_TXT")    private String literal;    
    
    @ManyToOne
    @JoinColumns({
    @JoinColumn(name = "ENTITY_ID", referencedColumnName = "ENTITY_ID"),
    @JoinColumn(name = "ENTITY_VERSION_NUM", referencedColumnName = "ENTITY_VERSION_NUM"),
    @JoinColumn(name = "ADDRESS_ID", referencedColumnName = "ADDRESS_ID")
    })
    private RimCoreEntyAddrs rimCoreEntyAddrs;

    public RimCoreEntyAddrParts() {
        
    }

    public Long getAddressId() {
        return addressId;
    }

    public void setAddressId(Long addressId) {
        this.addressId = addressId;
    }

    public Long getAddressPartId() {
        return addressPartId;
    }

    public void setAddressPartId(Long addressPartId) {
        this.addressPartId = addressPartId;
    }

    public Long getEntityId() {
        return entityId;
    }

    public void setEntityId(Long entityId) {
        this.entityId = entityId;
    }

    public Long getEntityVersionNum() {
        return entityVersionNum;
    }

    public void setEntityVersionNum(Long entityVersionNum) {
        this.entityVersionNum = entityVersionNum;
    }

    public Long getPartOrderNum() {
        return partOrderNum;
    }

    public void setPartOrderNum(Long partOrderNum) {
        this.partOrderNum = partOrderNum;
    }


    public void setPartType(String partType) {
        this.PartType = partType;
    }

    public String getPartType() {
        return PartType;
    }

    public void setLiteral(String literal) {
        this.literal = literal;
    }

    public String getLiteral() {
        return literal;
    }

    public void setRimCoreEntyAddrs(RimCoreEntyAddrs rimCoreEntyAddrs) {
        this.rimCoreEntyAddrs = rimCoreEntyAddrs;
    }

    public RimCoreEntyAddrs getRimCoreEntyAddrs() {
        return rimCoreEntyAddrs;
    }
}
